#ifndef INK_HASH_H
#define INK_HASH_H

#include "ink_foundation.h"

namespace ink
{

inline uint32_t BKDRHash(const char *str)
{
    uint32_t seed = 131; // 31 131 1313 13131 131313 etc..
    uint32_t hash = 0;

    while (*str)
    {
        hash = hash * seed + (*str++);
    }

    return (hash & 0x7FFFFFFF);
}

inline uint32_t string_hash(const char* str) {
    return BKDRHash(str);
}

}

#endif // INK_HASH_H
